﻿using Domain.Entity;
using Domain.Entity.ord;
using Domain.Entity.search;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.IRepository
{
    public interface IPurchase_hRepository
    {
        //分页查询进货单
        Task<FenYe<Purchase_h>> GetPurchase_h(FenYe<Purchase_h> fenYe,string? code,int? status,int? sup,string? starttime,string? endtime);


        //高级查询
        Task<FenYe<Purchase_h>> GetAdvancedPurchase_h(FenYe<Purchase_h> fenYe, string? code, string? starttotal, string? endtotal, string? startdate, string? enddate, string? startnum, string? endnum, int? status, int? sup, string? suplink, int? dep, int? user, string? createname, string? startcreatetime, string? endcreatetime, string? approvername, string? startapprovertime, string? endapprovertime);


        //删除进货单
        Task<int> DeletePurchase_h(int id);

        //新增进货单
        Task<int> AddPurchase_h(Purchase_h purchase_H);

        //根据id查询进货单
        Task<Purchase_h> GetPurchase_HById(int id);

        //修改进货单
        Task<int> UpdatePurchase_h(Purchase_h purchase_H);

        //修改进货单据状态
        Task<int> UpdateStatus(int purid, int status);

        //审核进货单
        Task<int> ApproverPurchase_h(int purid, int status, string approvername, string approvertime);

        //查询所有进货单据
        Task<List<Purchase_h>> GetAllPurchase_h();

        //更新入库数量和单据状态
        Task<int> Updatenum(Purchase_h purchase_H);

        //根据进货编号查询主键id和进货总数
        Task<Purchase_h> Getid(string code);

        //更新已退货数量及状态
        Task<int> UpdateRNum(int purid,int returnnum,int status);

        //根据货品id查询进货记录
        Task<List<Purchase_h>> GetAllPurchase_hBypid(int procid);


        //进货统计
        Task<PurchaseTJResult> Purchase_hTJ(string? timeType, string? code, int? sup, int? user, int? dep, string? starttime, string? endtime, int? page, int? pagesize);


        //更新已退货数量及状态
        Task<int> UpdateRNum(int purid, int returnnum, int status,int newnum);
    }
}
